#include <iostream>
using namespace std;

struct Node
{
    uint16_t num;
    Node *next = nullptr;
};

void insert(Node **headNode, uint16_t inNum)
{
    Node *currentNode = *headNode;
    Node *lastNode = nullptr;
    Node *newNode = new Node;
    newNode->num = inNum;
    
    while(1)
    {
        if(currentNode->num < newNode->num)
        {
            if(currentNode->next != nullptr)
            {
                lastNode = currentNode;
                currentNode = currentNode->next; // 跳到下一个node
            }
            else
            {
                currentNode->next = newNode; // 末尾插入
                return;
            }
        }
        else if(currentNode->num > newNode->num)
        {
            if(lastNode == nullptr){
                *headNode = newNode;
                (**headNode).next = currentNode; // 头部插入
            }
            else
            {
                lastNode->next = newNode;
                newNode->next = currentNode; // 中间插入
            }
            return;
        }
        else
        {
            delete newNode;
            return;
        }
    }
}

int main()
{
    uint16_t N;
    Node *headNode;

    cin >> N; // 去除整数个数
    cin >> N;
    headNode = new Node;
    headNode->num = N;
    
    while(cin >> N)
    {
        insert(&headNode,N);
    }
    
    for(Node *currNode = headNode; currNode != nullptr; currNode = currNode->next)
    {
        cout << currNode->num << endl;
    }
    
    return 0;
}